<form id="form" class="form-horizontal" method="post">
    {{if .NameGroup}}
    <div class="form-group">
        <label for="name" class="col-sm-4 control-label">用户名</label>
        <div class="col-sm-8">
            {{if .NameEdit}}
            <input type="text" class="form-control" id="name" name="name"
            required placeholder="请输入用户名" value="{{.NameV}}">
            {{else}}
            <p class="form-control-static form-static" id="name">{{.NameV}}</p>
            {{end}}
        </div>
    </div>
    {{end}}
    {{if .PwdGroup}}
    <div class="form-group">
        <label for="pwd" class="col-sm-4 control-label">密码</label>
        <div class="col-sm-8">
            <input type="password" class="form-control" id="pwd" name="pwd"
            required pattern=".{8,}" placeholder="请输入密码">
            {{if .PwdHint}}
            <p class="help-block">密码由8位或8位以上_,数字,字母组成</p>
            {{end}}
        </div>
    </div>
    {{end}}
    {{if .PwdRPTGroup}}
    <div class="form-group">
        <label for="pwd_repeat" class="col-sm-4 control-label">确认密码</label>
        <div class="col-sm-8">
            <input type="password" class="form-control" id="pwd_repeat" name="pwd_repeat"
            required pattern=".{8,}" placeholder="请确认密码">
            {{if .PwdHint}}
            <p class="help-block">密码由8位或8位以上_,数字,字母组成</p>
            {{end}}
        </div>
    </div>
    {{end}}
    {{if .EmailGroup}}
    <div class="form-group">
        <label for="email" class="col-sm-4 control-label">邮箱</label>
        <div class="col-sm-8">
            {{if .EmailEdit}}
            <input type="email" class="form-control" id="email" name="email"
            required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"
            placeholder="请输入邮箱" value="{{.EmailV}}">
            {{else}}
            <p class="form-control-static form-static" id="email">{{.EmailV}}</p>
            {{end}}
        </div>
    </div>
    {{end}}
    {{if .AgeGroup}}
    <div class="form-group">
        <label for="age" class="col-sm-4 control-label">年龄</label>
        <div class="col-sm-8">
            {{if .AgeEdit}}
            <input type="number" class="form-control" id="age" name="age" max="99" value="{{.AgeV}}">
            {{else}}
            <p class="form-control-static form-static" id="age">{{.AgeV}}</p>
            {{end}}
        </div>
    </div>
    {{end}}
    {{if .BirthGroup}}
    <div class="form-group">
        <label for="birth" class="col-sm-4 control-label">生日</label>
        <div class="col-sm-8">
            {{if .BirthEdit}}
            <input type="date" class="form-control" id="birth" name="birth" value="{{.BirthV}}">
            {{else}}
            <p class="form-control-static form-static" id="birth">{{.BirthV}}</p>
            {{end}}
        </div>
    </div>
    {{end}}
    {{if .ButtonGroup}}
    <div class="form-group">
        <div class="col-sm-offset-5 col-sm-5">
            <button type="submit" class="btn btn-default btn-lg btn-primary btn-block">
            {{if .Signin}}登录{{end}}
            {{if .Signup}}注册{{end}}
            {{if .Save}}保存{{end}}
            {{if .Edit}}编辑{{end}}
            </button>
        </div>
        <div class="col-sm-offset-4 col-sm-8 error" style="padding-top:10px">
            {{.Response}}
        </div>
    </div>
    {{end}}
</form>
{{if .Validation}}
<script>
$().ready(function(){
    $('#form').validate({
        rules: {
            name: {
                required: true,
                minlength: 2,
                maxlength: 255
            },
            pwd: {
                required: true,
                minlength: 8,
                maxlength: 255
            },
            pwd_repeat: {
                required: true,
                minlength: 8,
                maxlength: 255,
                equalTo:"#pwd"
            },
            email: {
                required: true,
                email:true
            },
            age: {
                number:true,
                min:12,
                max:99
            },
            birth: {
                date:true
            }
        }
  })
})
</script>
{{end}}